#pragma once

#include"Common.h"

class BuildTask
{
public:
	enum State{Undefined , WaitForCanMake , Asigned , Morphing , Done};
	enum Type{DoNothing , CreateUnit , Build};
	//--
	BuildTask()
		:WhatToBuild(UnitTypes::None),
		BaseIndex(0),
		Type(DoNothing),
		State(Undefined),
		Worker(NULL),
		WhereToBuild(-1 , -1)
	{
	}
	BuildTask(UnitType whatToBuild , int baseIndex)
		:WhatToBuild(whatToBuild),
		BaseIndex(baseIndex),
		State(WaitForCanMake),
		Worker(NULL),
		WhereToBuild(-1 , -1)
	{
		if(whatToBuild.isBuilding())
		{
			Type = Build;
		}
		else
		{
			Type = CreateUnit;
		}
	}
	//--
	UnitType WhatToBuild;
	int BaseIndex;
	Type Type;
	State State;
	Unit* Worker;
	TilePosition WhereToBuild;
};